package com.atguigu.eduService.client;

import com.atguigu.common.Result;
import com.atguigu.eduService.client.impl.VodClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author Summerday
 */
//指定从哪个服务中调用功能,名称需要与被调用的服务名保持一致
@FeignClient(value = "service-vod",fallback = VodClientImpl.class)
@Component //防止在其他位置注入VodClient时IDEA报错
public interface VodClient {

    //定义调用方法的全路径
    @DeleteMapping("/eduVod/video/{videoSourceId}")
    public Result removeVideo(@PathVariable("videoSourceId") String videoSourceId);//PathVariable需要指定参数名称

    @DeleteMapping("/eduVod/video/batch")
    public Result removeVideoList(@RequestParam("videoList") List<String> videoIdList);

}
